﻿var app = angular.module("ngtable", []);

app.controller("firstCtrl", function ($scope) {
    $scope.buttons = [
                { title: "biaoti1", type: "url", color: "red", data: "http://www.baidu.com" }
    ];
    $scope.addLine = function () {
        $scope.buttons.push({ title: "默认", type: "url", color: "red", data: "http://" });
    };
    $scope.deleteLine = function (index) {
        $scope.buttons.splice(index, 1);
    };
    $scope.changeType = function (index) {
        if ($scope.buttons[index].type === "share") {
            $scope.buttons[index].data = "";
        } else {
            $scope.buttons[index].data = "http://";
        }
    };
});
